package com.string;
public class Test {
	
public static void main(String... args) { 
String s = "00876art02"; 
StringBuffer digits = new StringBuffer(); 
StringBuffer letters = new StringBuffer(); 
char[] chrs = s.toCharArray(); 
for(char c: chrs) { 
if(((int)c >= 48) && ((int)c <= 57)) { 
digits.append(c); 
}else { 
letters.append(c); 
} 
} 
System.out.println(digits+"\n"+letters);
} 
}